<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: coap_event.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('coap__event_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">coap_event.h</div></div>
</div><!--header-->
<div class="contents">
<a href="coap__event_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * coap_event.h -- libcoap Event API</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * Copyright (C) 2016 Olaf Bergmann &lt;bergmann@tzi.org&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> *</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment"> * This file is part of the CoAP library libcoap. Please see README for terms</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment"> * of use.</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment"> */</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#ifndef COAP_EVENT_H_</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#define COAP_EVENT_H_</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &quot;<a class="code" href="libcoap_8h.html">libcoap.h</a>&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="keyword">struct </span><a class="code hl_struct" href="structcoap__context__t.html">coap_context_t</a>;</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="keyword">struct </span><a class="code hl_struct" href="structcoap__session__t.html">coap_session_t</a>;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">   28</a></span> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_typedef" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a>;</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="group__events.html#ga58978fec0cb0a118e2e47b3eb9b5efdc">   33</a></span><span class="preprocessor">#define COAP_EVENT_DTLS_CLOSED        0x0000</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="group__events.html#gaeedad13a6a9e652948097bb1f8290229">   34</a></span><span class="preprocessor">#define COAP_EVENT_DTLS_CONNECTED     0x01DE</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="group__events.html#ga367c24eff1326e0e3f8bd1d7dcd5363a">   35</a></span><span class="preprocessor">#define COAP_EVENT_DTLS_RENEGOTIATE   0x01DF</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="group__events.html#ga4b7987047870eb07d52a9bb7a04b04ad">   36</a></span><span class="preprocessor">#define COAP_EVENT_DTLS_ERROR         0x0200</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="group__events.html#gaf2a1235d6d66e20095721a60c5ccdf84">   41</a></span><span class="preprocessor">#define COAP_EVENT_TCP_CONNECTED      0x1001</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="group__events.html#ga4c9db860dda8985faa989922fccafc4a">   42</a></span><span class="preprocessor">#define COAP_EVENT_TCP_CLOSED         0x1002</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="group__events.html#gaa06f99fe2908c1d1f14e114ebaa13bc6">   43</a></span><span class="preprocessor">#define COAP_EVENT_TCP_FAILED         0x1003</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="group__events.html#ga75fd68f962ebce49338db56c9bb7bec1">   48</a></span><span class="preprocessor">#define COAP_EVENT_SESSION_CONNECTED  0x2001</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="group__events.html#gaecbcf934fd89dd203cbbea4f768e41fc">   49</a></span><span class="preprocessor">#define COAP_EVENT_SESSION_CLOSED     0x2002</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="group__events.html#ga84fedccf8f1ae24163454156a7932229">   50</a></span><span class="preprocessor">#define COAP_EVENT_SESSION_FAILED     0x2003</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">   60</a></span><span class="keyword">typedef</span> int (*<a class="code hl_typedef" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a>)(<span class="keyword">struct </span><a class="code hl_struct" href="structcoap__context__t.html">coap_context_t</a> *,</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>                                    <a class="code hl_typedef" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a> event,</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>                                    <span class="keyword">struct </span><a class="code hl_struct" href="structcoap__session__t.html">coap_session_t</a> *session);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__events.html#gaff5f3d7ce262ca60c48498b4d4d9938b">coap_register_event_handler</a>(<span class="keyword">struct</span> <a class="code hl_struct" href="structcoap__context__t.html">coap_context_t</a> *<a class="code hl_variable" href="structcoap__session__t.html#a8f8e37457b167cc8b95fadd7eeffd8d7">context</a>,</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>                            <a class="code hl_typedef" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a> hnd);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span><a class="code hl_define" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__events.html#ga29f689b91842169c70871f47852d1d92">coap_set_event_handler</a>(<span class="keyword">struct</span> <a class="code hl_struct" href="structcoap__context__t.html">coap_context_t</a> *<a class="code hl_variable" href="structcoap__session__t.html#a8f8e37457b167cc8b95fadd7eeffd8d7">context</a>,</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>                            <a class="code hl_typedef" href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a> hnd);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span><a class="code hl_define" href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__events.html#ga71fb9f4722d1355e28d3928fe5c56af1">coap_clear_event_handler</a>(<span class="keyword">struct</span> <a class="code hl_struct" href="structcoap__context__t.html">coap_context_t</a> *<a class="code hl_variable" href="structcoap__session__t.html#a8f8e37457b167cc8b95fadd7eeffd8d7">context</a>);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span> </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span><span class="preprocessor">#endif </span><span class="comment">/* COAP_EVENT_H */</span><span class="preprocessor"></span></div>
<div class="ttc" id="agroup__events_html_ga29f689b91842169c70871f47852d1d92"><div class="ttname"><a href="group__events.html#ga29f689b91842169c70871f47852d1d92">coap_set_event_handler</a></div><div class="ttdeci">COAP_DEPRECATED void coap_set_event_handler(struct coap_context_t *context, coap_event_handler_t hnd)</div><div class="ttdoc">Registers the function hnd as callback for events from the given CoAP context context.</div><div class="ttdef"><b>Definition</b> <a href="coap__event_8c_source.html#l00024">coap_event.c:24</a></div></div>
<div class="ttc" id="agroup__events_html_ga47e52d9f286d209a75c5e2ce34af67ac"><div class="ttname"><a href="group__events.html#ga47e52d9f286d209a75c5e2ce34af67ac">coap_event_handler_t</a></div><div class="ttdeci">int(* coap_event_handler_t)(struct coap_context_t *, coap_event_t event, struct coap_session_t *session)</div><div class="ttdoc">Type for event handler functions that can be registered with a CoAP context using the unction coap_se...</div><div class="ttdef"><b>Definition</b> <a href="coap__event_8h_source.html#l00060">coap_event.h:60</a></div></div>
<div class="ttc" id="agroup__events_html_ga71fb9f4722d1355e28d3928fe5c56af1"><div class="ttname"><a href="group__events.html#ga71fb9f4722d1355e28d3928fe5c56af1">coap_clear_event_handler</a></div><div class="ttdeci">COAP_DEPRECATED void coap_clear_event_handler(struct coap_context_t *context)</div><div class="ttdoc">Clears the event handler registered with context.</div><div class="ttdef"><b>Definition</b> <a href="coap__event_8c_source.html#l00030">coap_event.c:30</a></div></div>
<div class="ttc" id="agroup__events_html_ga75a08ceb9a855937288ac3996656c872"><div class="ttname"><a href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a></div><div class="ttdeci">unsigned int coap_event_t</div><div class="ttdoc">Scalar type to represent different events, e.g.</div><div class="ttdef"><b>Definition</b> <a href="coap__event_8h_source.html#l00028">coap_event.h:28</a></div></div>
<div class="ttc" id="agroup__events_html_gaff5f3d7ce262ca60c48498b4d4d9938b"><div class="ttname"><a href="group__events.html#gaff5f3d7ce262ca60c48498b4d4d9938b">coap_register_event_handler</a></div><div class="ttdeci">void coap_register_event_handler(struct coap_context_t *context, coap_event_handler_t hnd)</div><div class="ttdoc">Registers the function hnd as callback for events from the given CoAP context context.</div><div class="ttdef"><b>Definition</b> <a href="coap__event_8c_source.html#l00018">coap_event.c:18</a></div></div>
<div class="ttc" id="alibcoap_8h_html"><div class="ttname"><a href="libcoap_8h.html">libcoap.h</a></div></div>
<div class="ttc" id="alibcoap_8h_html_a0ac5555e3d6ef821c228a03d10b334e3"><div class="ttname"><a href="libcoap_8h.html#a0ac5555e3d6ef821c228a03d10b334e3">COAP_DEPRECATED</a></div><div class="ttdeci">#define COAP_DEPRECATED</div><div class="ttdef"><b>Definition</b> <a href="libcoap_8h_source.html#l00049">libcoap.h:49</a></div></div>
<div class="ttc" id="astructcoap__context__t_html"><div class="ttname"><a href="structcoap__context__t.html">coap_context_t</a></div><div class="ttdoc">The CoAP stack's global state is stored in a coap_context_t object.</div><div class="ttdef"><b>Definition</b> <a href="net_8h_source.html#l00148">net.h:148</a></div></div>
<div class="ttc" id="astructcoap__session__t_html"><div class="ttname"><a href="structcoap__session__t.html">coap_session_t</a></div><div class="ttdef"><b>Definition</b> <a href="coap__session_8h_source.html#l00056">coap_session.h:56</a></div></div>
<div class="ttc" id="astructcoap__session__t_html_a8f8e37457b167cc8b95fadd7eeffd8d7"><div class="ttname"><a href="structcoap__session__t.html#a8f8e37457b167cc8b95fadd7eeffd8d7">coap_session_t::context</a></div><div class="ttdeci">struct coap_context_t * context</div><div class="ttdoc">session's context</div><div class="ttdef"><b>Definition</b> <a href="coap__session_8h_source.html#l00070">coap_session.h:70</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a14d23a24002734ac2a3b997119f008e.html">coap2</a></li><li class="navelem"><a class="el" href="coap__event_8h.html">coap_event.h</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
